package com.test;

import com.entity.AddressList;
import com.mapper.AddressListMapper;
import com.service.AddressListService;
import com.service.imp.AddressListServiceImp;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:application-context.xml")
public class Demo {
    @Autowired
    private AddressListMapper addressListMapper;
    @Autowired
    private AddressListService addressListService;
    @Test
    public void findAll(){
        List<AddressList> all = addressListMapper.findAll();
        System.out.println(all);
    }

    @Test
    public void insert(){

        addressListMapper.insert("忘","120","123@qq.com","同事");
    }
    @Test
    public void delete(){
        addressListMapper.delete(1);
    }
}
